package com.cayden.components.kafka;


import com.cayden.componets.aop.factory.AopContain;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

/**
 * kafka 消费者 aop
 *
 * @author Shaun Wu
 * @date 2021/10/21 22:46
 */
@Aspect
@Component
public class KafkaAop implements AopContain {

    @Around("@annotation(org.springframework.kafka.annotation.KafkaListener)")
    @Override
    public Object around(ProceedingJoinPoint proceedingJoinPoint) {
        Object proceed = null;
        try {
            proceed = proceedingJoinPoint.proceed();
        } catch (Throwable t) {
            t.printStackTrace();
        } finally {
            // TODO
        }
        return proceed;
    }

}
